package com.wans.apis.lottery.client;

import com.wans.apis.lottery.fallback.LotterySSQClientFallback;
import com.wans.common.result.ResponseResult;
import com.wans.model.lottery.ssq.dos.SSQ;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

// openfeign 默认使用服务名进行调用
@FeignClient(value = "realm-ssq", path = "/lottery/ssq/history", contextId = "lotterySSQClient", fallback = LotterySSQClientFallback.class)
public interface LotterySSQClient {

    // 获取数据库中最新的期次
    @GetMapping("/getNew")
    ResponseResult<SSQ> getSSQNewHistoryCode();

    // 插入数据库中最新的期次
    @PostMapping("/saveNew")
    ResponseResult<Integer> saveNewHistoryCode(@RequestBody SSQ ssq);

    // 获取数据库中指定的期次的数据
    @GetMapping("/getCode")
    ResponseResult<SSQ> getSSQHistoryByCode(@RequestParam("code") String code);




}
